package com.tian.controller;

import com.tian.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@RestController
public class StuFooController {

    @Autowired
    private StuService service;
    @GetMapping("/getStu")
    public Object getStu(int id){
        return service.getStuInfo(id);

    }

    @PostMapping("/saveStu")
    public Object saveStu(){
        service.saveStu();
        return "OK";
    }

    @PostMapping("/updateStu")
    public Object updateStu(int id){
        service.updateStu(id);
        return "OK";
    }

    @PostMapping("/deleteStu")
    public Object deleteStu(int id){
        service.deleteStu(id);
        return "OK";
    }
}
